﻿namespace WinnerCMS.Common.Security.CodeCharts
{
    using Security;
    using System;
    using System.Collections;
    using System.Linq;

    internal static class Upper
    {
        public static IEnumerable AlphabeticPresentationForms()
        {
            return CodeChartHelper.GetRange(0xfb00, 0xfb4f, delegate (int i) {
                if ((((i < 0xfb07) || (i > 0xfb12)) && ((i < 0xfb18) || (i > 0xfb1c))) && (((i != 0xfb37) && (i != 0xfb3d)) && ((i != 0xfb3f) && (i != 0xfb42))))
                {
                    return i == 0xfb45;
                }
                return true;
            });
        }

        public static IEnumerable ArabicPresentationFormsA()
        {
            return CodeChartHelper.GetRange(0xfb50, 0xfdfd, delegate (int i) {
                if ((((i < 0xfbb2) || (i > 0xfbd2)) && ((i < 0xfd40) || (i > 0xfd4f))) && ((i != 0xfd90) && (i != 0xfd91)))
                {
                    return (i >= 0xfdc8) && (i <= 0xfdef);
                }
                return true;
            });
        }

        public static IEnumerable ArabicPresentationFormsB()
        {
            return CodeChartHelper.GetRange(0xfe70, 0xfefc, i => i == 0xfe75);
        }

        public static IEnumerable Cham()
        {
            return CodeChartHelper.GetRange(0xaa00, 0xaa5f, delegate (int i) {
                if (((i < 0xaa37) || (i > 0xaa3f)) && (((i != 0xaa4e) && (i != 0xaa4f)) && (i != 0xaa5a)))
                {
                    return i == 0xaa5b;
                }
                return true;
            });
        }

        public static IEnumerable CjkCompatibilityForms()
        {
            return CodeChartHelper.GetRange(0xfe30, 0xfe4f);
        }

        public static IEnumerable CjkCompatibilityIdeographs()
        {
            return CodeChartHelper.GetRange(0xf900, 0xfad9, delegate (int i) {
                if (((i != 0xfa2e) && (i != 0xfa2f)) && (i != 0xfa6e))
                {
                    return i == 0xfa6f;
                }
                return true;
            });
        }

        public static IEnumerable CombiningHalfMarks()
        {
            return CodeChartHelper.GetRange(0xfe20, 0xfe26);
        }

        public static IEnumerable DevanagariExtended()
        {
            return CodeChartHelper.GetRange(0xa8e0, 0xa8fb);
        }

        public static IEnumerable HalfWidthAndFullWidthForms()
        {
            return CodeChartHelper.GetRange(0xff01, 0xffee, delegate (int i) {
                if (((((i != 0xffbf) && (i != 0xffc0)) && ((i != 0xffc1) && (i != 0xffc8))) && (((i != 0xffc9) && (i != 0xffd0)) && ((i != 0xffd1) && (i != 0xffd8)))) && (((i != 0xffd9) && (i != 0xffdd)) && ((i != 0xffde) && (i != 0xffdf))))
                {
                    return i == 0xffe7;
                }
                return true;
            });
        }

        public static IEnumerable HangulJamoExtendedA()
        {
            return CodeChartHelper.GetRange(0xa960, 0xa97c);
        }

        public static IEnumerable HangulJamoExtendedB()
        {
            return CodeChartHelper.GetRange(0xd7b0, 0xd7fb, delegate (int i) {
                if (((i != 0xd7c7) && (i != 0xd7c8)) && (i != 0xd7c9))
                {
                    return i == 0xd7ca;
                }
                return true;
            });
        }

        public static IEnumerable HangulSyllables()
        {
            return CodeChartHelper.GetRange(0xac00, 0xd7a3);
        }

        public static bool IsFlagSet(UpperCodeCharts flags, UpperCodeCharts flagToCheck)
        {
            return ((flags & flagToCheck) != UpperCodeCharts.None);
        }

        public static IEnumerable Javanese()
        {
            return CodeChartHelper.GetRange(0xa980, 0xa9df, i => (i == 0xa9ce) || ((i >= 0xa9da) && (i <= 0xa9dd)));
        }

        public static IEnumerable KayahLi()
        {
            return CodeChartHelper.GetRange(0xa900, 0xa92f);
        }

        public static IEnumerable MeeteiMayek()
        {
            return CodeChartHelper.GetRange(0xabc0, 0xabf9, delegate (int i) {
                if (i != 0xabee)
                {
                    return i == 0xabef;
                }
                return true;
            });
        }

        public static IEnumerable MyanmarExtendedA()
        {
            return CodeChartHelper.GetRange(0xaa60, 0xaa7b);
        }

        public static IEnumerable Rejang()
        {
            return CodeChartHelper.GetRange(0xa930, 0xa953).Concat<int>(new int[] { 0xa95f });
        }

        public static IEnumerable SmallFormVariants()
        {
            return CodeChartHelper.GetRange(0xfe50, 0xfe6b, delegate (int i) {
                if (i != 0xfe53)
                {
                    return i == 0xfe67;
                }
                return true;
            });
        }

        public static IEnumerable Specials()
        {
            return CodeChartHelper.GetRange(0xfff9, 0xfffd);
        }

        public static IEnumerable TaiViet()
        {
            return CodeChartHelper.GetRange(0xaa80, 0xaac2).Concat<int>(CodeChartHelper.GetRange(0xaadb, 0xaadf));
        }

        public static IEnumerable VariationSelectors()
        {
            return CodeChartHelper.GetRange(0xfe00, 0xfe0f);
        }

        public static IEnumerable VerticalForms()
        {
            return CodeChartHelper.GetRange(0xfe10, 0xfe19);
        }
    }
}

